//
//  LYSelectCompanyCollectionCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/23.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYSelectCompanyCollectionCell.h"

@interface LYSelectCompanyCollectionCell()

@property (nonatomic, strong) UIView *backView;
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation LYSelectCompanyCollectionCell

- (void)setModel:(PublicCategoryElementModel *)model {
    if (!_backView ) {
        _backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 30*Scale)];
        _backView.layer.cornerRadius = 2*Scale;
        _backView.layer.masksToBounds = YES;
        _backView.layer.borderWidth = lineH;
        _backView.layer.borderColor = THEMECOLOR_OF_ORANGE.CGColor;
        [self.contentView addSubview:_backView];
    }
    _backView.width = model.itemWidth + 20*Scale;
    
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:_backView.bounds];
        _titleLabel.textColor = THEMECOLOR_OF_ORANGE;
        _titleLabel.font = Font(Font_14);
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [_backView addSubview:_titleLabel];
    }
    _titleLabel.text = [NSString stringWithFormat:@"%@  X", model.name];
}

- (void)buttonClick:(UIButton *)button{
    _block();
}

@end
